public class Runnian {
    public static void main(String[] args) {
        int c=0;
        System.out.println("1900到2020的所有闰年：");
        for(int y=1900;y<=2020;y++)
        {
            if((y%4==0&&y%100!=0)||(y%400==0))
            {
                System.out.print(y);
                if(++c%5==0)
                    System.out.println();
                else
                    System.out.print(",");
            }
        }
        if(c%5!=0)
            System.out.println();
        System.out.printf("共%d个%n",c);
    }
}